package com.zzzyh.springproject.service;

import com.zzzyh.springproject.mapper.CategoryMapper;
import com.zzzyh.springproject.pojo.Category;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CategoryService {
    @Autowired
    CategoryMapper categoryMapper;

    public List<Category> getList() {
        return categoryMapper.getList();
    }

    public Category getCategory(Integer id) {
        return categoryMapper.getCategory(id);
    }

    public void addCategory(Category category) {
        categoryMapper.addCategory(category);
    }

    public void updateCategory(Category category) {
        categoryMapper.updateCategory(category);
    }

    public void deleteCategory(Integer id) {
        categoryMapper.deleteCategory(id);
    }
}
